cmake_minimum_required(VERSION 3.4.1)

if (CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
    message(STATUS "optional:-std=c++11")
endif (CMAKE_COMPILER_IS_GNUCXX)


#指定源文件的目录
aux_source_directory(src/main/cpp src_list)
aux_source_directory(src/main/cpp/bzip2 src_list)
#引入头文件目录
include_directories(src/main/jniLibs/jpeg)
#指定共享库的库目录
link_directories(src/main/jniLibs)

add_library(
        native-lib
        SHARED
        ${src_list})

add_library(
        libjpeg
        SHARED
        IMPORTED)
set_target_properties(
        libjpeg
        PROPERTIES IMPORTED_LOCATION
        ../../../../src/main/jniLibs/armeabi-v7a/libjpeg.so)

find_library(log-lib
        log)

target_link_libraries(
        native-lib
        libjpeg
        #加入该依赖库
        jnigraphics

        ${log-lib})